package com.dsj.gxrd.modules.activity.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dsj.gxrd.modules.activity.domain.entity.RdScore;
import com.dsj.gxrd.modules.activity.mapper.RdScoreMapper;
import com.dsj.gxrd.modules.activity.service.RdScoreService;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author songpin566
 * @date 2023/10/09
 **/
@Service
public class RdScoreServiceImpl extends ServiceImpl<RdScoreMapper,RdScore> implements RdScoreService {


    @Override
    public List<RdScore> selectScoreList(RdScore score) {
        return this.lambdaQuery().like(score.getShowName() != null, RdScore::getShowName, score.getShowName()).list();
    }

    @Override
    public boolean insertScore(RdScore score) {
        score.setDelFlag(0);
        return save(score);
    }

    @Override
    public boolean updateScore(RdScore score) {
        return updateById(score);
    }

    @Override
    public AjaxResult removes(List<Long> ids) {
        return removeBatchByIds(ids)?AjaxResult.success("删除成功"):AjaxResult.error();
    }

}
